<html>

<head>
<meta charset="UTF-8">
<title>部门管理</title>
</head>
<body>
	<#import "/page.ftl" as page />
	<#include "/head.ftl"/>
	<script type="text/javascript" src="/js/task.js"></script>
	<script type="text/javascript">
		$(".st").val(${statu});
	</script>
	<link rel="stylesheet" type="text/css" href="/css/task.css">
	<div class="content">
		<div class="tab">
			<div class="tab-header">
				<a href="/task/addtask" title="添加任务" class="btn btn-setting btn-add" id="add"> <i class="iconfont icon-add"
					style="font-size: 16px;"></i>
				</a>
				<a title="刷新" class="btn btn-setting" onclick="refresh(this)">
					<i class="iconfont icon-refresh"></i>
				</a>
				<div class="tab-tool">
					<select class="st" style="height: 30px">
						<option value="0">-全部-</option>
						<#list status['task_manage_status'] as status>
							<option value="${status.value}">${status.name}</option>
						</#list>
					</select>
					<input class="key" type="text" placeholder="按标题、类型或状态查找...">
					<a class="search-btn taskmanage-search">
						<i class="iconfont icon-search"></i>
					</a>
				</div>
			</div>
			<div class="tab-content">
				<div>
					<table style="width: 100%; border-collapse: collapse;">
						<tr>
							<th>类型</th>
							<th>标题</th>
							<th>发布时间</th>
							<th>发布人</th>
							<th>状态</th>
							<th>操作</th>
						</tr>
						<#if tasklist.content?size gt 0>
						<#list (tasklist.content?sort_by(['tmPushTime'])?reverse) as task>
							<tr>
								<#list status['task_manage_type'] as status>
									<#if status.value==task.type>
										<td><span style="color:${(status.color)!''}" class="btn">${status.name}</span></td>		
									</#if>
								</#list>
								<td>${task.tmTitle}</td>
								<td>${task.tmPushTime}</td>
								<td>${task.user.realName}</td>
									<#list status['task_manage_status'] as status>
										<#if status.value==task.tmStatus>
											<td><span class="btn" style="background:${(status.color)!''}" class="btn">${status.name}</span></td>		
										</#if>
									</#list>
								<td>
									<a href="/task/showTask?id=${task.tmId}" title="查看任务" class="btn btn-look"><i class="iconfont icon-search"></i><span> 查看</span></a>
									<a href="/task/editTask?id=${task.tmId}" title="修改任务" class="btn btn-update"><i class="iconfont icon-brush"></i><span> 修改</span></a>
									<a id="${task.tmId}" class="btn btn-delete task-delete"><i class="iconfont icon-trash"></i><span> 删除</span></a>
								</td>
							</tr>
						</#list>
						<#else>
							<tr><td colspan="7">没有任务可查看噢~快去 <a href="/task/addtask" title="添加任务" style="text-decoration: underline;"> 添加任务 </a></tr>
						</#if>
					</table>
				</div>
			</div>
			<!-- url:路径
				pager：分页对象
				color：分页按钮的颜色
				 -->
				<@page.page url=requestURI pager=tasklist/>
		</div>
	</div>
</body>
</html>